﻿using System.Drawing;
using GraphDrawing2.Canvas;

namespace GraphDrawing2.V2.Graph.Model
{
    public class Link : IVisualElement, IRenderable
    {
        readonly ILinkView view;
        readonly PointF startPoint;

        public StateHints Hints { get; set; }
        public ElementsModel Owner { get; set; }

        public Link(PointF startPoint)
        {
            this.startPoint = startPoint;
            view = new LinkView();
            view.Update(startPoint, startPoint);
        }

        public void UpdateEndPoint(PointF point)
        {
            view.Update(startPoint, point);
        }

        public void Render(DrawingContext dc)
        {
            view.Render(dc);
        }
    }
}